﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ListPosts.aspx.cs" Inherits="NhanAi.Admin.ListPost" %>

<%@ Register Src="~/Admin/PagingBar.ascx" TagName="PagingBar" TagPrefix="uc2" %>
<%@ Register Src="~/Admin/SearchBox.ascx" TagName="SearchBox" TagPrefix="uc" %>
<%@ Import Namespace="NhanAi.Entity" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <h3>Danh sách bài viết</h3>
     <uc:SearchBox runat="server" ID="searchBox" />
    <form runat="server" id="form1"  style="margin-left:10px; display:inline-block;">
        <asp:LinkButton ID="lnkUpdateIntro" runat="server" Text="Cập nhật bài viết giới thiệu" OnClick="lnkUpdateIntro_Click"></asp:LinkButton>
    </form>
    <form id="form" action="ListPosts.aspx" method="post">
        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
            <tr>
                <th class="table-header-check">
                    <input type="checkbox" id="check-all" />
                </th>
                <th class="table-header-repeat line-left">
                    <a href="">Tiêu đề</a>
                </th>
                <th class="table-header-repeat line-left">
                    <a href="">Ngày đăng</a>
                </th>
                <th class="table-header-repeat line-left">
                    <a href="">Chủ đề</a>
                </th>
                <th class="table-header-repeat line-left">
                    <a href="">Số lượt xem</a>
                </th>
                <th class="table-header-repeat line-left">
                    <a href="">Trạng thái</a>
                </th>
                 <th class="table-header-repeat line-left">
                    <a href="">Người đăng</a>
                </th>
                <th class="table-header-options line-left"></th>
            </tr>

            <asp:Repeater ID="rptData" runat="server">
                <ItemTemplate>
                    <tr>
                        <td>
                            <input type="checkbox" id='ids<%#Eval("Id")%>' value="<%#Eval("Id")%>" name="ids" />
                        </td>

                        <td>
                            <%# Eval("Title") %>
                        </td>
                        <td>
                            <%# Eval("PostDate","{0:dd/MM/yyyy hh:mm:ss tt}")%>
                        </td>
                        <td>
                           
                           <asp:Repeater ID="rptTaxItem" runat="server" EnableViewState="false" DataSource='<%#Eval("Taxonomies") %>'  >
                               <ItemTemplate>
                                   <a href="ListPost.aspx?cate=<%# DataBinder.Eval(Container.DataItem,"Id") %>" class="taxonomy"><%# DataBinder.Eval(Container.DataItem,"TermName") %></a> &nbsp;
                               </ItemTemplate>
                           </asp:Repeater>
                        </td>
                        <td><%#Eval("ViewCount") %></td>
                         <td><%#Eval("Status").ToString()=="1"?"Cho phép đăng":"Nháp" %></td>
                        <td>
                            <%#Eval("User.UserLogin") %>
                        </td>
                        <td>
                            <a href="/Admin/EditPost.aspx?id=<%#Eval("Id") %>">Chỉnh sửa</a>

                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>

        </table>
    </form>
    <uc2:PagingBar ID="paging" runat="server"></uc2:PagingBar>
</asp:Content>
